Control method for peripheral device in host computer connectable to a plurality of peripheral devices

ABSTRACT

A method of loading a program on a host computer connectable to a plurality of peripheral devices includes inquiring a device type of a peripheral device connected thereto, knowing the type of the peripheral device by receiving a response to an inquiry, and loading a control program corresponding to the type.

This application is a continuation of application Ser. No. 07/742,860,filed Aug. 8, 1991, now abandoned.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a control method of peripheral devicein a host side and a peripheral device side in a system comprising ahost computer connectable to a plurality of peripheral devices, andperipheral devices connected to the host comuter.

2. Related Background Art

Conventionally, in an information processing system composed of a hostcomputer and a plurality of peripheral devices connected thereto, thehost computer uses different programs for each device, and each devicetype, to control each peripheral device.

Thus, on the host side, in order to cope with a variety of devices ordevice types connectable therewith, it has been commonly practiced toprepare many programs in an external storage unit such as a hard disk,thereby allowing the operator to determine and select an appropriateprogram among many programs in accordance with a system configuration,and load it into an internal memory in the host computer.

Also, it has been practiced that when parameters for controlling aperipheral device can be set with switches on the peripheral deviceside, the operator must set the same values by inputting them into thehost computer, to reflect those setting values to the controls on thehost side.

However, to perform the above operations, the operator must have a largeamount of knowledge in connection with peripheral devices and controlprograms thereof. Further, the operations for confirming what type ofdevice is being connected, and selecting and loading an appropriateprogram, or inputting and setting the values set on the device side intothe host computer were a burden on the operator.

SUMMARY OF THE INVENTION

An object of the present invention is to provide an informationprocessing system allowing the operator to load an appropriate programin a simple manner, without the needs of examining what peripheraldevice is connected to the host computer, and determining and selectinga program to be loaded in accordance with that result.

Another object of the present invention is to provide an informationprocessing system capable of reflecting the information set on theperipheral device side to the controls on the host computer side.

According to one aspect, the present invention which achieves theseobjectives relates to a method of loading a program on a host computerconnectable to a plurality of peripheral devices, comprising the step ofinquiring a device type of a peripheral device connected thereto,knowing the type of the peripheral device by receiving a response to theinquiry, and loading a control program corresponding to the type.

According to another aspect, the present invention which achieves theseobjectives relates to a method of controlling a peripheral device in ahost computer connectable to a plurality of peripheral devices,comprising the step of requesting a peripheral device connected theretoto transfer a peripheral device control program for the host computerstored in the peripheral device, storing the program which istransferred in accordance with the request, and controlling theperipheral device with the program.

According to still another aspect, the present invention which achievesthese objectives relates to a method of controlling a peripheral deviceto set control parameters on a host computer connectable to a pluralityof peripheral devices, comprising the step of operating an operationunit on the peripheral device, determining the control parameters byreading operation results on the operation unit, receiving a request fortransferring the control parameters, and transferring the determinedcontrol parameters with the request.

Other objectives and advantages besides those discussed above shall beapparent to those skilled in the art from the description of a preferredembodiment of the invention which follows. In the description, referenceis made to accompanying drawings, which form a part thereof, and whichillustrate an example of the invention. Such example, however, is notexhaustive of the various embodiments of the invention, and thereforereference is made to the claims which follow the description fordetermining the scope of the invention.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block configuration diagram of an information processingsystem in one example.

FIG. 2 is a cross-sectional view of a read scan unit of an image readdevice.

FIG. 3 is a block configuration diagram of the image read device.

FIG. 4 is a diagram showing the transitions of phase in a SCSI bus.

FIG. 5 is a timing chart showing a selection processing operation.

FIG. 6 is a flowchart showing a procedure of control software readoperation.

FIG. 7 is a table showing a format of the INQUIRY command.

FIG. 8 is a table showing a format of the sense data.

FIG. 9 is a table showing the contents for the type code of peripheraldevice.

FIG. 10 is a flowchart showing a processing procedure of a host computerin an image reading process.

FIG. 11 is a flowchart showing a procedure for transferring the settinginformation on a peripheral device to the host computer.

FIGS. 12A and 12B are tables showing formats of the SEND command.

FIG. 13 is a block configuration diagram of an image read device in athird example.

FIG. 14 is a flowchart showing a procedure of a control program readprocessing in the third exmaple.

FIG. 15 is a table showing a format of the READ command.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

The examples of the present invention will be described below withreference to the drawings.

In each example given below, there is provided a scanner as a peripheraldevice, and the start and control of an image read processing with thescanner will be explained as the example.

First example!

In this example, a host computer issues a command inquiring a devicetype to each peripheral device connected thereto, knows a correspondingprogram by receiving and interpreting a response, and loads the program.

FIG. 1 is a block diagram showing the configuration of an informationprocessing unit in this example, which is common to the second and thirdexamples.

In the same figure, 1 is the host computer for controlling various typesof peripheral devices in accordance with control programs correspondingto those peripheral devices.

2 is an image read unit (scanner) for converting the documentinformation of an original laid on an original board to an electricsignal with a pickup element such as CCD, 3 is a hard disk which is anexternal memory for storing the system control program and image data. 4is a high-speed printer such as a laser beam printer for recording animage onto a recording medium based on the information of the electricsignal. 5 is an SCSI bus for electrical connection between the hostcomputer 1, the scanner 2, the hard disk 3 and the printer 4.

SCSI (Small Computer System Interface) is an interface which ANSI(American National Standard Institute) has established as ANSIX3.131-1986.

One SCSI bus allows up to eight devices to be connected, with eachconnected device being given ID of 0 to 7.

An image processing operation will be described below.

Note that IDs of the host computer 1, the scanner 2, the hard disk 3 andthe printer 4 are set as 0, 1, 2 and 3, respectively.

The host computer 1 first acquires a utilization right of the SCSI bus5, and selects the scanner 2 of ID=1. Then, the host computer 1transmits a READ command via the SCSI bus 5 to the scanner 2. Thescanner 2 reads an original laid on the original board, and transfersits original image via the SCSI bus 5 to the host computer 1. The hostcomputer 1 stores its original image in an internal memory. Similarly,to preserve the original image, the host computer 1 selects the harddisk 3 of ID=2, and transfers and writes the original image in aninternal memory of the host computer 1 via the SCSI bus 5 to the harddisk 3.

Also, to print out the original image, the host computer 1 selects theprinter 4 of ID=3, and transfers and prints out the original image inthe internal memory of the host computer 1 via the SCSI bus 5 to theprinter 4.

In the information processing system as configured above, the hostcomputer 1 issues an inquiry information to each input/output device(scanner 2, hard disk 3 and printer 4 in this example), interprets anindividual response information from each input/output device,identifies an input/output device connected to an input/output bus,selects an appropriate control software, based on that identifiedresult, to read it from storage means to the host computer, so that theoptimal system start environment can be set.

Also, in the image processing system as configured above, if eachpredetermined switch information necessary for the image processing oneach input/output device is set, each predetermined information set oneach input/output device is transferred via the input/output bus to thehost computer 1 by means of a transfer feature (which is provided on thescanner 2, the hard disk 3 or the printer 4, but on the scanner 2 inthis example), and the start of each input/output device is carried outby interpreting each predetermined switch information transferredthereto and based on each predetermined information set therein.

Referring now to FIG. 2, a specific transfer operation and a processexecution processing operation in the scanner 2 and the host computer 1will be described.

FIG. 2 is a detailed cross-sectional view for explaining a constitutionof the scanner 2 as shown in FIG. 1, and the constitution and theoperation will be described below.

An original is laid between a pressure plate 22 for automatic originalfeeder and original glass and an original board plate 20, with its uppersurface down, and pressed against a glass surface of the original boardglass plate 20 by a presser member 21 made up of a soft material. Theoriginal is illuminated by a fluorescent lamp 23, and an optical path 33is formed so that its reflected light is concentrated via mirrors 24,25, 26 and a lens 27 on a surface of an image sensor 28 having aplurality of light receiving elements arranged in a column. A slidingboard 30 has the fluorescent lamp 23 and the mirror 24 mounted thereon,while a sliding board 31 has the mirrors 25 and 26 mounted thereon,performing the sub scan movement along a shaft 29.

The sliding boards 30 and 31 move at a relative speed 2:1 by applyingPLL with a DC servo motor. In a flat bed scan, the sliding board 30starts to read from a position indicated by the arrow B, moving in adirection as indicated by the arrow D, so that the original image on theoriginal board glass 20 is focused onto a surface of the image sensor28.

The image sensor 28 outputs a digital image signal of 8 bits indicatingthe density of image sequentially read for each line.

The automatic original feeder 22 feeds an original from the arrow 50toward the arrow 51 by means of an original guide member 44, anautomatic original feeder cover 40, five original feeding rollers 41 anddriven rollers 42 opposed thereto. When the automatic original feeder 22is used, a reading position of the sliding board 30 is one as indicatedby the arrow C. If a leading end of the original inserted from adirection of the arrow 50 reaches the reading position C, reading of theoriginal is started, and after termination of the reading, the originalis exhausted in a direction as indicated by the arrow 51.

The automatic original feeder cover 40 can be opened around a fulcrum 43in a direction as indicated by the arrow 52, when the original is jammedwithin the automatic original feeder 22, thereby permitting the originalto be removed.

34 is a switch panel on which a read start instruction switch and adensity setting switch are disposed.

FIG. 3 is a block diagram for explaining a circuit configuration of thescanner 2 as indicated in FIG. 1.

In the figure, 71 is a central processing unit (CPU) composed of amicrocomputer. 72 is a scanner program ROM (read only memory) in which ascanner control program is prewritten, allowing the CPU 71 to controlthe scanner 2 with the program in the ROM 72. 73 is a RAM (random accessmemory) useful as a working memory for the CPU 71. 74 is an image sensormade up of CCD, having a plurality of light receiving elements arrangedin a column, for converting the document information of original into anelectric signal. 75 is a CCD driver circuit for driving the image sensor74. 76 is an amplifier for amplifying the electric signal output fromthe image sensor 74. 77 is an A/D converter for converting an analogsignal output from the amplifier 76 to a digital signal.

78 is an image processing circuit for making a shading correction,enlargement, reduction, negative-positive inversion, and clipping forthe digital image signal output from the A/D converter 77.

79 is a buffer RAM which is an image memory as large as a plurality oflines for storing the image signal output from the image processingcircuit 78 in a unit of one main scan line. 80 is a SCSI controller forperforming the SCSI communication such as the transmission of imagesignal, command reception, status transmission via the SCSI bus 5 to thehost computer 1. 81 is a timing circuit for generating a timing signalfor the CCD driver circuit 75 and the image processing circuit 78. 82 isan address controller for generating an address in writing an imagesignal output from the image processing circuit 78 into the buffer RAM79, or an address in reading the image signal from the buffer RAM 79 tothe SCSI controller 80. 83 is a CPU bus for electrically connecting theCPU 71, the scanner program ROM 72, the RAM 73, the image processingcircuit 78, the timing circuit 81, and the address controller 82. 84 isa fluorescent lamp for illuminating the original. 85 is a power sourcefor lighting up the fluorescent lamp 84 as above described, in which thelighting or extincting of the fluorescent lamp 84 is made with aninstruction of the CPU 71. 86 is a motor for moving the sliding boards30, 31 as shown in FIG. 2 in the sub scan direction. 87 is a motordriver for driving the motor 86. 88 is a home position detection sensorfor detecting a read start position of the sliding board 30 as shown inFIG. 2.

89 is a motor for rotating the original feed roller 41 of the automaticoriginal feeder 22 as shown in FIG. 2.

90 is a motor driver for driving the motor 89.

91 is an original sensor for detecting the original. 92 is a readposition detection sensor for detecting a leading end of the original.93 is a cover sensor for detecting an open/close state of the automaticoriginal feeder cover 40.

100 is a switch for inputting a read start instruction, and 101 is asetting switch group for setting the read density.

Referring now to FIG. 4, the phase processing operation of the SCSI bus5 as shown in FIG. 1 will be described.

Each device connected to the SCSI bus 5 controls the bus phase as shownin FIG. 4 in a sequence of the arrow for the command processing.

700 is a bus free phase which is a state where each device does not usethe SCSI bus 5.

701 is an arbitration phase which is a phase where a device connected tothe SCSI bus 5 acquires a utilization right of the bus.

702 is a selection phase which is a phase where the device (initiator)having acquired the utilization right of the SCSI bus 5 in thearbitration phase 701 selects another device (target) and connects itlogically.

In this example, in reading an image, the host computer 1 becomes aninitiator and the scanner 2 becomes a target, while in transferring theimage read start information or the read density information, thescanner 2 becomes the initiator and the host computer 1 becomes thetarget.

703 is a command phase which is a phase where the target receives aseries of commands from the initiator.

704 is a data phase which is a phase for transmitting and receiving databetween the initiator and the target.

705 is a status phase which is a phase where the target transfers anexecuted result of command to the initiator. When the command isnormally terminated, a GOOD status (00) is transferred, while when thecommand is terminated abnormally, a Check Condition status (02) istransferred.

706 is a message in phase which is a phase where the target transfers amessage to the initiator. If the execution of the command is terminated,a command complete message (00) is transferred.

707 is a reselection phase which is a phase where the targettransferring a disconnect message in the message in phase 706 andopening the bus temporarily selects the initiator and reconnects itlogically.,

Referring now to a timing chart as shown in FIG. 5, the SCSI busselection processing operation will be described.

FIG. 5 is the timing chart for explaining the selection processingoperation in the selection phase 702 as shown in FIG. 4. Note that theselection of device is performed by a signal BSY, a signal SEL, andsignals DB0 to DB7.

Firstly, a device (initiator) acquiring the utilization right of theSCSI bus 94 waits for the passage of time t1 (timing (a)).

Subsequently, the initiator outputs an identification code of 0 to 7corresponding to the device to be selected to the signals DB0 to DB7(timing (b)).

Next, the initiator sets a (timing (c)) signal SEL when the time t2 haspassed by.

And the device (target) to be selected responds by setting the signalBSY (timing (d)), if the signal SEL is set and its own identificationcode is detected in the signals DB0 to DB7.

Subsequently, the initiator resets the signal SEL after the time t3 haspassed from the detection of the signal BSY of target (timing (e)).

With the above sequence, the selection of device is terminated. Unlessthe target may respond to the selection of the initiator within 250msec, with the signal BSY, the selection becomes false.

Referring now to a flowchart as shown in FIG. 6, the peripheral devicecontrol program selection processing will be described.

FIG. 6 is the flowchart showing one example of each control programselection process procedure for an input/output device connectable tothe SCSI bus 5 as shown in FIG. 1.

Firstly, at step S61, the host computer 1 prepares an identificationcode variable N in a work RAM internally provided and sets 0.

Next, at step S62, the host computer 1 selects a device as shown withthe identification code storage variable N in the previous sequence. Atstep S63, the host computer 1 waits for a responce from the selecteddevice for 250 msec at maximum, and if NO, the routine proceeds to stepS67 and the followings, by considering that there is no input/outputdevice corresponding to this identification code, while if YES, the hostcomputer 1 transmits the INQUIRY command as described thereafter to theselected device at step S64. Next, at step S65, the host computer 1receives a sense data which is a response from the input/output device,interpreting the sense data returned, and judging that the device is ascanner 3, for example.

At step S66, the host computer 1 reads the control program of thescanner 3 from the hard disk 2 into a main memory, because theinput/output device connected thereto was judged as the scanner 3 atstep S65.

Subsequently, at step S67, 1 is added to the identification code storagevariable N. And at step S68, the host computer 1 judges whether or notthe identification code storage variable N is less than 7, and if YES,the routine returns to step S62 to continue the automatic selectionprocessing, while if NO, that is, all control softwares for theinput/output device have been read into the main memory, the processingis terminated.

FIG. 7 is a table for explaining a format of the INQUIRY command in theimage processing system according to the present invention.

As will be seen from this table, the INQUIRY command is constituted of 6bytes from byte 0 to byte 5, with 12h (hexadecimal) indicating theINQUIRY command being set in the byte 0. Also, in the byte 4, theAllocation length (36) is set, indicating the length of sense datareturned from other input/output device.

FIG. 8 is a table showing a format of sense data returned from aninput/output device connected to the SCSI bus 5 as shown in FIG. 1. Notethat the formats of the INQUIRY command and the sense data are common toeach input/output device.

As will be seen from this table, BIT0 to BIT4 in the byte 0 can be usedto specify a device type of the device, with the Peripheral Device Type.The bytes 8 to 15 are a Vendor Identification field for setting a makername, and the byte 16 to 31 are a Product Identification field forsetting a product name. And the bytes 32 to 35 are a Product Revisionfield for showing a revision number. This allows the host computer 1 toselect not only the device type but also more minutely, a controlsoftware, such as a scanner control software with the product name a,ver. 1.01 made by A company, and a scanner control softwre with theproduct name b, ver. 3.01 made by B company. Note that this examplecorresponds to an instance of setting with the ASCII string.

FIG. 9 is a table showing the detail of peripheral device type as shownin FIG. 8.

As will be seen from this table, for the scanner 3, for example, 06 isentered. The host computer 1 can select an appropriate control softwareby judging the input/output device with the Peripheral Device Type.

As described above, according to this invention, the host computer isconfigured to issue an inquiry information to each input/output device,interpreting an individual response information from each input/outputdevice, identifying an input/output device to be connected to theinput/output bus, and reading an appropriate control software into thehost computer, based on an identified result, so that a conventionalcomplicated instruction operation, in which the operator judges andselects the appropriate control software in accordance with variousinput/output devices connectable to the bus, can be avoided, and anoptimal control software necessary for an information processing systemconstructed is automatically loaded simply by connecting a desiredinput/output device to the bus, whereby the excellent effects capable ofsetting the system start environment can be achieved.

Second example!

In the following, an example of transferring the setting values with theswitch on a peripheral device side to a host computer side will bedescribed.

In this example, the peripheral device is a scanner 2 as described inFIGS. 2 and 3, and referring to a flowchart as shown in FIG. 10, theoperation of reading a plurality of originals with the scanner 2 will bedescribed as the example.

FIG. 10 is the flowchart showing a processing procedure of the hostcomputer in the above operation. Firstly, at step S101, the operatorinputs a file name or the number of originals useful in storing an imageread from the scanner 2 into a hard disk 3 to the host computer 1.

Proceeding to step S102, the host computer 1 waits for the SEND commandto be entered from the scanner 2. Here, the operator lays a firstoriginal on an original board of the scanner 2, making the settings suchas read density, read resolution, read magnification, and read size withthe switch on a panel of the scanner 2. If a read start switch 100 isdepressed, the scanner 2 transfers the density, read magnification, readsize set on the panel of the scanner 2 to the host computer 1, using theSEND command in the format as shown in FIGS. 12A and 12B. Afterwards,the scanner 2 waits for the READ command to be sent out from the hostcomputer 1.

Next, at step S103, the host computer 1 interprets the SEND command sentfrom the scanner 2, and sets inside the read density, read resolution,read magnification and read size.

At step S104, the host computer 1 issues the READ command to the scanner2 to instruct the start of original image read processing.

If receiving the READ command, the scanner 2 moves the sliding board 30as shown in FIG. 2 to a position of the arrow A, and lights up thefluorescent lamp 23 to make the correction for light quantity. Next, itmoves the sliding board 30 to a position of the arrow B. And the scanner2 reads an original for each one line, and transfers it to the hostcomputer 1.

Then, at step S105, the host computer 1 judges whether or not alloriginals have been read, and if NO, the routine returns to step S102,to repeat the original read processing, and if YES, the processing isterminated.

Referring now to FIG. 11, a processing operation will be described inwhich the scanner 2 transfers the switch information such as readdensity, read resolution, read magnification, read size and read startinformation to the host computer 1.

FIG. 11 is a flowchart showing one example of the switch informationtransfer procedure of the scanner 2 as shown in FIG. 1 to the hostcomputer 1.

Firstly, at step S111, if the scanner 2 confirms that the SCSI bus 5 isin the bus free phase 700, the scanner 2 acquires the bus right byplacing it in the arbitration phase 701. Next, the scanner 2 places theSCSI bus 5 in the selection phase 702, and selects the host computer 1.Thus, the host computer 1 and the scanner 2 are logically connected.

At step S112, in the subsequent command phase 703, the scanner 2 sendsthe SEND command as described thereafter having the Transfer Data Typeof 80H (hexadecimal).

On the other hand, if receiving the SEND command, the host computer 1examines the Transfer Data Type of the SEND command, and judges it asthe transfer of switch information when the value is 80H.

At step S113, in the data phase 704, the switch information having theformat as shown in FIGS. 12A and 12B are sent from the scanner 2 to thehost computer 1. The host computer 1 interprets the switch information,and stores the read density, read resolution, read magnification, readsize and read start information in an internal work memory.

If the scanner has transferred all the switch information to the hostcomputer 1 the host computer 1 places the SCSI bus in the status phase705, and sends the Good status (00H) indicating that the SEND command isnormally terminated to the scanner 2. At step S114, the scanner 2receives the Good status (00H) and knows that the SEND command isnormally terminated.

Next, placing the SCSI bus 5 in the message in phase 706, the hostcomputer 1 sends the command complete message (00H) indicating that theSEND command is all terminated to the scanner 2. At step S115, thescanner 2 receives the command complete message (00H) and knows that theSEND command has been terminated. It places the SCSI bus 5 in the busfree phase 700 and terminates the SEND command.

FIGS. 12A and 12B are tables showing one example of the format for theSEND command in the image procesing system as shown in FIG. 1.

FIG. 12A shows the CDB (Command Descriptor Block) in the SEND command,constituted of byte 0 to byte 9, in which the byte 0 is an OperationCode, containing 2AH (hexadecimal) indicating the SEND command.

The byte 2 is the Transfer Data Type in which 80H is set in transferringthe switch information.

The byte 6 to byte 8 are the Transfer Length in which the parameterblock transfer number 13 is set.

FIG. 12B shows a parameter block in the SEND command, constituted ofbyte 0 to byte 12, the byte 0 of the parameter block containing theoperation instruction which indicates that the read operation is startedby the operator's depressing of a read start switch, when it is 1.

The byte 1 contains a value in a range from 1 to 255 to show the readdensity, indicating the highest density at 1 and the lowest density at255, with the center at 128.

The bytes 2 to 3 contain a value in a range from 75 to 300 to show theresolution, which is set such as 75 for 75 DPI (Dot Per Inch), or 300for 300 DPI.

The bytes 5 to 8 contain a value showing the main scan width for readingin a unit of byte.

The bytes 9 to 12 contain a value showing the sub scan length forreading in a unit of line.

While in the above example, the panel switch information of the scanneris transferred via the SCSI bus 5, except for the file name and thenumber of read originals, it is also possible to make the partialsetting on the host computer 1, or set the number of read originals withthe panel switch of the scanner 2.

As above described, according to this invention, the setting values suchas switches on each input/output device are transferred via theinput/output bus to the host computer, which controls each input/outputdevice of transfer origin by analyzing those transferred setting values,so that if various predefined settings such as switches changeable byeach input/output device are made, the setting contents are transferredto the host computer, which then starts the processing. Accordingly,after the initial settings necessary on the host computer are made, eachprocessing can be executed only by setting the switch informationnecessary on each input/output device, thereby taking effect in reducinggreatly the burden of the operator on the system operation, as comparedwith the instructing operation based on a conventional host computer.

Third example!

In the host computer, the capacity necessary for storing programs isincreased with the increase of corresponding device products, but someprograms may be rarely used, which decreases the utilization efficiencyof memory.

Also, when a new program was needed for a new product, it was necessaryto add this program to the memory.

In this example, an example in which the control program for the hostcomputer to control a peripheral device is provided on the peripheraldevice side will be described.

FIG. 13 is a block diagram showing a circuit configuration of a scanner2 as the peripheral device in this example.

The configuration of the same figure is different from that of FIG. 3only in that FIG. 13 has a host computer program ROM 95, but otherportions are the same and the explanation will be omitted.

95 is the host computer program ROM in which a program for the hostcomputer to control the scanner 2 is prewritten, and this program can beoutput to the SCSI bus 5 via the CPU bus 83 and the SCSI controller 80.

Next, the operation for the host computer 1 to read a host computercontrol program from the ROM 95 of the scanner 2 will be described withreference to a flowchart on the host computer side as shown in FIG. 14.

Firstly, at step S141, if the host computer confirms that the SCSI bus 5is in the bus free phase, the host computer acquires the bus utilizationright by placing it in the arbitration phase 701. Next, the hostcomputer places the SCSI but 5 in the selection phase 702, and selectsthe scanner 2. Thus, the host computer 1 and the scanner 2 are logicallyconnected.

At step S142, the host computer 1 places the SCSI bus 5 in the commandphase 703, and sends the READ command as described thereinafter with theTransfer Data Type being 80H (hexadecimal).

On the other hand, if receiving the READ command the CPU 71 of thescanner 2 examines the Transfer Data Type of the READ command, and,judges it as the transfer of program when the value is 80H.

At step S143, placing the SCSI bus 5 in the data phase 704, the hostcomputer 1 receives a program from the scanner 2. The CPU 71 of thescanner 2 reads the program written therein one byte after another fromthe host computer program ROM 95, and writes it via the CPU bus 83 tothe SCSI controller 80. The SCSI controller 80 transfers this readprogram via the SCSI bus 94 to the host computer 1. This operation isrepeated until all programs written in the host computer program ROM 95have been transferred.

At step S144, if the scanner 2 has transferred all the programs writtenin the host computer program ROM 95, the host computer 1 places the SCSIbus in the status phase 705, and sends the Good status (00H) indicatingthat the SEND command is normally terminated to the host computer. Thehost computer receives the Good status (00H) and knows that the READcommand is normally terminated.

At step S145, placing the SCSI bus 5 in the message in phase 706, thescanner sends the command complete message (00H) indicating that theREAD command is all terminated to the host computer 1. The host computer1 receives the command complete message (00H) and knows that the READcommand processing has been all terminated. And it places the SCSI bus 5in the bus free phase 700 and terminates the READ command.

FIG. 15 shows a format example of the READ command in this example. TheREAD command is composed of a CDB (Command Descriptor Block) of 10bytes, from byte 0 to byte 9. The byte 0 is an Operation Code,containing 28H (hexadecimal) indicating the READ command. The byte 2 isthe Transfer Data Type in which 00H is set in reading an image data, and80H is set in reading the host computer program. The byte 6 to byte 8are the Transfer Length in which the transfer byte number is set.

The host computer 1 writes programs read from the scanner 2 into amemory within a main body, as above described, reads and executes themas necessary.

As above described, according to the present invention, the hostcomputer control program for the host computer to operate a peripheraldevice is stored in the peripheral device, and this control program isread via the input/output bus to the host computer, with an instructionof the host computer, and then executed, so that

(1) it is unnecessary to store a large number of control programs tocope with a variety of device products connectable to the externalstorage such as a floppy disk unit or hard disk unit, or the internalstorage such as ROM, and

(2) as the control program is placed within the peripheral device, theoperation is made easier in moving and installing the peripheral device,or connecting it to another host computer.

What is claimed is:
 1. A system including a host computer connected to abus and a peripheral device connected thereto, wherein said bus isconnectable to a plurality of types of peripheral devices, each of aplurality of peripheral devices connected to said bus comprising:programmemory means for storing a control program for controlling theperipheral device by the host computer in advance; acceptance means foraccepting a request command for requesting transfer of the controlprogram from the host computer; and transfer means for transferring thecontrol program to said host computer in response to the request commandaccepted by said acceptance means, and said host computercomprising:selection means for selecting each of said plurality ofperipheral devices connected to said bus, one by one; transmission meansfor transmitting the request command to the peripheral device selectedby said selecting means; receiving means for receiving the controlprogram transferred from said selected peripheral device in response tothe request command; internal memory means for storing said controlprogram received by said receiving means; and control means forcontrolling said selected peripheral device with said control programstored in the internal memory means.
 2. The system according to claim 1,wherein said peripheral device further comprises:operation means forgenerating a plurality of settings; reading means for reading operationresults by said operation means; and determining means for determiningcontrol parameters on the basis of the operation results read by saidreading means, said peripheral device transferring the controlparameters determined by said determining means by said transfer meansin response to a request command for requesting transfer of said controlparameters.
 3. A method of loading a program on a host computerconnected to a bus, from an external memory connected thereto, saidexternal memory storing a plurality of control programs eachcorresponding to a plurality of types of peripheral devices connectableto the bus, respectively, said method comprising the steps of:issuing anidentification number on the bus for checking whether the identificationnumber is assigned to any of a plurality of peripheral devices connectedto the bus; selecting a peripheral device in which the identificationnumber is assigned, if a first response to the issue of theidentification number is received within a predetermined interval;transmitting an inquiry command to the selected peripheral device forinquiring of the selected peripheral device about a device type thereof;receiving a second response representing the device type to said inquirycommand from said selected peripheral device; determining the devicetype of said selected peripheral device on the basis of the secondresponse; loading one of said plurality of control programscorresponding to the determined device type of said selected peripheraldevice on said host computer from said external memory; incrementing theidentification number if the loading is completed or the first responsein not received within the predetermined interval; and repeating thepreceding steps with the incremented identification number until theincremented identification number exceeds a predetermined number.
 4. Themethod of loading a program according to claim 1, wherein said hostcomputer and said peripheral devices are connected via an SCSI bus, andsaid inquiry command is sequentially performed for all the ID numbersavailable in the SCSI bus except for the host itself.
 5. A method ofcontrolling a peripheral device connected to a bus by a host computerconnected thereto, wherein said host computer is connectable to aplurality of types of peripheral devices, comprising the stepsof:providing each of a plurality of peripheral devices connected to saidbus with a program memory storing a control program for controlling arespective peripheral device by the host computer in advance; selectingeach of a plurality of peripheral devices connected to said bus, one byone; transmitting a request command from said host computer to theselected one of the peripheral devices for requesting transfer of thecontrol program for controlling said selected peripheral device;transferring the control program from said selected peripheral device tosaid host computer in response to said request command; storing saidcontrol program transferred from said selected peripheral device in aninternal memory in said host computer; controlling said selectedperipheral device by said host computer with said control program storedin said internal memory; operating an operation unit on said peripheraldevice; determining control parameters by reading operation results onsaid operation unit by said peripheral device; transmitting a secondrequest command from said host computer to said peripheral device forrequesting transfer of the control parameters; transferring said controlparameters determined by said determining step from said peripheraldevice to said host computer in response to said second request command;storing said control parameters transferred from said peripheral devicein said internal memory in said host computer; and controlling saidperipheral device by said host computer with said control program andsaid control parameters stored in said internal memory.
 6. A hostcomputer connected to an external memory via a bus, said external memorystoring a plurality of control programs each corresponding to aplurality of types of peripheral devices connectable to said bus,respectively, said host computer comprising:issuing means for issuing anidentification number on the bus for checking whether the identificationnumber is assigned to any of a plurality of peripheral devices connectedto the bus; receiving means for receiving a response from one of saidplurality of peripheral devices; selecting means for selecting aperipheral device to which the identification number is assigned, if afirst response to the issue of the identification number is received bysaid receiving means within a predetermined interval; transmission meansfor transmitting an inquiry command to the peripheral device selected bysaid selecting means for inquiring of the selected peripheral deviceabout a device type thereof; judging means for judging the device typeof said selected peripheral device on the basis of a second responserepresenting the device type to the inquiry command,, received by saidreceiving means; loading means for loading one of said plurality ofcontrol programs corresponding to the device type of said selectedperipheral device on said host computer from said external memory;increment means for incrementing the identification number if theloading by said loading means is completed or the first response is notreceived within the predetermined interval; and control means forcontrolling said issuing means to issue the incremented identificationnumber unless the incremented identification number exceeds apredetermined number.